<template>
  <div class="loading" v-show="isActive">
    <div class="loading-icon">666</div>
  </div>
</template>

<script lang="ts">
export default {
  name: 'Loading',
  props: {
    isActive: {
      type: Boolean,
      default: false,
    },
  },
}
</script>

<style scoped>
.loading {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.loading-icon {
  width: 46px;
  height: 46px;
}

.loading-icon svg {
  width: 100%;
  height: 100%;
  animation: rotate 1s linear infinite;
}

.loading-icon circle {
  fill: none;
  stroke: #fff;
  stroke-width: 3.8;
  stroke-linecap: round;
}

.loading-icon circle:nth-child(2) {
  animation-delay: -0.5s;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}
</style>
